"""
适配器核心模块

本模块包含适配器系统的核心组件：
- base: 抽象基类和接口定义
- models: 标准数据模型
- exceptions: 异常类定义

使用示例：
```python
# 导入基类
from app.adapters.core import (
    HistoricalDataAdapter,
    RealtimeDataAdapter,
    HybridDataAdapter
)

# 导入数据模型
from app.adapters.core import Bar, Tick, Orderbook

# 导入异常
from app.adapters.core import (
    AdapterError,
    AdapterConnectionError,
    AdapterTimeoutError
)

# 或者一次性导入所有
from app.adapters.core import *
```

作者: 架构组
创建日期: 2025-10-04
"""

# 导入抽象基类
from .base import (
    DataAdapter,
    HistoricalDataAdapter,
    RealtimeDataAdapter,
    HybridDataAdapter,
    StreamingDataAdapter,
    AdapterType,
)

# 导入数据模型
from .models import (
    # 枚举
    DataFrequency,
    TickDirection,
    MarketType,
    Exchange,
    
    # 核心模型
    Bar,
    Tick,
    Orderbook,
    OrderbookLevel,
    MarketDataModel,
    
    # 辅助函数
    parse_symbol,
    build_symbol,
)

# 导入异常
from .exceptions import (
    # 基础异常
    AdapterError,
    
    # 连接相关
    AdapterConnectionError,
    AdapterAuthenticationError,
    
    # 数据相关
    AdapterDataError,
    AdapterDataFormatError,
    AdapterDataValidationError,
    
    # 超时和限流
    AdapterTimeoutError,
    AdapterRateLimitError,
    
    # 资源相关
    AdapterNotFoundError,
    AdapterNotSupportedError,
    
    # 配置和订阅
    AdapterConfigError,
    AdapterSubscriptionError,
    
    # 辅助函数
    wrap_exception,
    is_retryable_error,
    get_retry_delay,
)

# 导入能力声明模块
from .capabilities import (
    # 枚举
    DataCapability,
    MarketCapability,
    PerformanceLevel,
    DataFreshness,
    ReliabilityLevel,
    CostLevel,
    
    # 核心类
    AdapterCapabilities,
    
    # 辅助函数
    match_capabilities,
    find_best_adapter,
    create_basic_quote_capabilities,
    create_realtime_capabilities,
    create_fundamental_capabilities,
)

# 导入元数据模块
from .metadata import (
    # 枚举
    AdapterStatus,
    AdapterCategory,
    
    # 核心类
    AdapterMetadata,
    AdapterDependency,
    ConfigParameter,
    
    # 辅助函数
    create_tushare_metadata,
    create_akshare_metadata,
)

# 定义公共API
__all__ = [
    # 抽象基类
    "DataAdapter",
    "HistoricalDataAdapter",
    "RealtimeDataAdapter",
    "HybridDataAdapter",
    "StreamingDataAdapter",
    "AdapterType",
    
    # 数据模型 - 枚举
    "DataFrequency",
    "TickDirection",
    "MarketType",
    "Exchange",
    
    # 数据模型 - 核心类
    "Bar",
    "Tick",
    "Orderbook",
    "OrderbookLevel",
    "MarketDataModel",
    
    # 数据模型 - 辅助函数
    "parse_symbol",
    "build_symbol",
    
    # 异常类
    "AdapterError",
    "AdapterConnectionError",
    "AdapterAuthenticationError",
    "AdapterDataError",
    "AdapterDataFormatError",
    "AdapterDataValidationError",
    "AdapterTimeoutError",
    "AdapterRateLimitError",
    "AdapterNotFoundError",
    "AdapterNotSupportedError",
    "AdapterConfigError",
    "AdapterSubscriptionError",
    
    # 异常辅助函数
    "wrap_exception",
    "is_retryable_error",
    "get_retry_delay",
    
    # 能力声明 - 枚举
    "DataCapability",
    "MarketCapability",
    "PerformanceLevel",
    "DataFreshness",
    "ReliabilityLevel",
    "CostLevel",
    
    # 能力声明 - 核心类
    "AdapterCapabilities",
    
    # 能力声明 - 辅助函数
    "match_capabilities",
    "find_best_adapter",
    "create_basic_quote_capabilities",
    "create_realtime_capabilities",
    "create_fundamental_capabilities",
    
    # 元数据 - 枚举
    "AdapterStatus",
    "AdapterCategory",
    
    # 元数据 - 核心类
    "AdapterMetadata",
    "AdapterDependency",
    "ConfigParameter",
    
    # 元数据 - 辅助函数
    "create_tushare_metadata",
    "create_akshare_metadata",
]

# 版本信息
__version__ = "2.0.0"
__author__ = "架构组"
__description__ = "市场数据服务适配器核心模块 - 支持能力声明和智能路由"

